﻿using Dict.DataModel;
using System;
using System.Collections.Generic;


namespace Battle.Engine.LogicModel
{
    public class FTalentBuff
    {
        public TalentBuffTriggerTimer triggerTimer;//buff挂载时机
        public BuffCondition triggerCondition;//buff挂载条件
        public FBuffTrigger buffTrigger;

        public FTalent talent;

        public FTalentBuff(FTalent talent, string buffid, TalentBuffTriggerTimer triggerTimer, BuffTriggerCondition condition, string conditionArgs, double percent, int select)
        {
            this.talent = talent;
            this.triggerTimer = triggerTimer;
            switch(condition)
            {
                case BuffTriggerCondition.PropertyVal:
                    this.triggerCondition = new PropertyValCondition();
                    this.triggerCondition.init(this.talent.actor, conditionArgs);
                    break;
                case BuffTriggerCondition.HpPercent:
                    this.triggerCondition = new HpPercentCondition();
                    this.triggerCondition.init(this.talent.actor, conditionArgs);
                    break;
                default:
                    //未实现的条件类型一律处理成无条件限制
                    this.triggerCondition = new BuffCondition();
                    this.triggerCondition.init(this.talent.actor, conditionArgs);
                    break;
            }
            this.buffTrigger = new FBuffTrigger(buffid, percent, select, this.talent.engineData);
        }

    }
}
